package com.wicket.mcp.service;

import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.stereotype.Service;

@Service
public class SQLQueryService {
    @Tool(description = "查询数据库中所有的表的SQL")
    public String queryAllTables(){
        return "SELECT TABLE_NAME , TABLE_COMMENT FROM information_schema.tables WHERE TABLE_SCHEMA = DATABASE()";
    }

    @Tool(description = "查询数据库中的表的数据的SQL")
    public String queryTable(@ToolParam(description = "表名") String tableName){
        return "SELECT * FROM " + tableName;
    }
}

